<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>FocusListItem</title>
<!--style start-->
<link href="../../style/doc.css" rel="stylesheet" type="text/css">
<!--style end-->

<!--script start-->
<!--[if lt IE 9]><script src="/common/html5/3.7.3/html5.js"></script><![endif]-->
<!--script end-->
</head>
<body class="docContent">
<h1>Form</h1>
<section>
  <h2>依赖</h2>
  <p>Page Verifier Utils</p>
</section>
<section>
  <h2>简介</h2>
  <p>表单</p>
</section>
<section>
  <h2>用法</h2>
  <article>
  	<pre>&lt;form id=&quot;form&quot;&gt;&lt;/form&gt;</pre>
  	<pre>
&lt;script type=&quot;text/javascript&quot;&gt;
var form=new Form();
&lt;/script&gt;
	</pre>
	<pre>
{"fieldsRules": {
    "base": {
        "userName": {
            "label": "登录名",
            "required": true,
            "pattern": "^[A-Za-z]{1}[A-Za-z0-9]{3,19}$",
            "placeholder": "",
            "title": "4-20位字母或数字的组合，区分大小写，第一位为字母",
            "type": "",
            "length": 500
        }
    }
}
fieldsRules 顶级命名
base 规则组命名
userName 字段名
label 字段前标签
required 必填
pattern 规则
patternName 规则名，包含参数生成pattern
placeholder 未输入显示值
title 字段前字段名
type 控件类型，主要使必需的提示语变化
length 数据库表字段长度，不可超越
   </pre>
  </article>
</section>
<section>
  <h2>属性</h2>
  <table class="table">
    <thead>
      <tr>
        <th>名称</th>
        <th>类型</th>
        <th>描述</th>
        <th>默认值</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>ACTION_CREATE</td>
        <td>String</td>
        <td>创建关键字</td>
        <td>actionCreate</td>
      </tr>
      <tr>
        <td>ACTION_EDIT</td>
        <td>String</td>
        <td>修改关键字</td>
        <td>actionEdit</td>
      </tr>
      <tr>
        <td>prototype.sourceRuleNames</td>
        <td>Array</td>
        <td>原始规则名称，进行对比使用</td>
        <td></td>
      </tr>
      <tr>
        <td>prototype.ruleNames</td>
        <td>Array</td>
        <td>规则名称</td>
        <td></td>
      </tr>
      <tr>
        <td>prototype.formData</td>
        <td>Array</td>
        <td>表单数据</td>
        <td></td>
      </tr>
      <tr>
        <td>prototype.formRule</td>
        <td>Object</td>
        <td>表单规则</td>
        <td></td>
      </tr>
      <tr>
        <td>prototype.fieldsRule</td>
        <td>Object</td>
        <td>字段规则</td>
        <td></td>
      </tr>
      <tr>
        <td>prototype.formRuleLoaded</td>
        <td>Boolean</td>
        <td>表单规则已加载</td>
        <td>false</td>
      </tr>
    </tbody>
  </table>
</section>
<section>
  <h2>方法</h2>
  <table class="table">
    <thead>
      <tr>
        <th>方法名</th>
        <th>参数</th>
        <th>返回值</th>
        <th>说明</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>extend</td>
        <td>obj1 被修改,obj2 修改来源</td>
        <td>Object</td>
        <td>继承，后面规则覆盖前面规则</td>
      </tr>
      <tr>
        <td>bindFieldsPattern</td>
        <td></td>
        <td>void</td>
        <td>绑定字段列表规则</td>
      </tr>
      <tr>
        <td>bindFieldPattern</td>
        <td></td>
        <td>void</td>
        <td>绑定字段规则</td>
      </tr>
      <tr>
        <td>getFrameFormSerialize</td>
        <td></td>
        <td>Array</td>
        <td>获得页面中iframe内部的主要表单值</td>
      </tr>
      <tr>
        <td>getSelectorValue</td>
        <td>selector</td>
        <td>void</td>
        <td>获得某一选择器的值</td>
      </tr>
      <tr>
        <td>getData</td>
        <td></td>
        <td>Object</td>
        <td>获得数据内部使用getFormData方法</td>
      </tr>
      <tr>
        <td>getFormData</td>
        <td></td>
        <td>Object</td>
        <td>获得数据内部使用getFormData方法</td>
      </tr>
      <tr>
        <td>getFormDataItemValue</td>
        <td></td>
        <td>String</td>
        <td>获得表单一个字段项的数据</td>
      </tr>
      <tr>
        <td>validate</td>
        <td></td>
        <td>Boolean</td>
        <td>验证表单数据</td>
      </tr>
      <tr>
        <td>resetInputValue</td>
        <td></td>
        <td>void</td>
        <td>表单中输入值重置</td>
      </tr>
      <tr>
        <td>resetTextAreaValue</td>
        <td></td>
        <td>void</td>
        <td>表单中多行输入值重置</td>
      </tr>
      <tr>
        <td>clearSelectSelected</td>
        <td></td>
        <td>void</td>
        <td>表单中选择框值重置</td>
      </tr>
      <tr>
        <td>updateRuleNames</td>
        <td></td>
        <td></td>
        <td>更新规则名称</td>
      </tr>
      <tr>
        <td>contrastRuleNames</td>
        <td></td>
        <td>Boolean</td>
        <td>对比规则名称，判断是否需要更新</td>
      </tr>
      <tr>
        <td>loadRule</td>
        <td>url,callBack</td>
        <td>void</td>
        <td>读取规则</td>
      </tr>
      <tr>
        <td>submitHandle</td>
        <td></td>
        <td>Boolean</td>
        <td>提交处理,默认值行验证方法</td>
      </tr>
    </tbody>
  </table>
</section>
</body>
</html>